import sys
# file = sys.stdout
# file.write("hello")

# file = open('test.txt', 'r')
#
# print(file.read())
#
# file.close()

# # 不需要写close
# with open('test.txt', 'r', encoding='utf-8') as file2:
#     list2=file2.readlines()
#     print(list2)



with open('test.txt', 'w', encoding='utf-8') as file2:
    file2.write('hello')



with open('test.txt', 'a', encoding='utf-8') as file3:
    file3.write('day day up')


